﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmallERP.DAL;
using SmallERP.MODEL.FoundationModel;

namespace SmallERP.Bll.PinBan
{
    public class PrinterBLL
    {
        public static List<Printer_info> GetAllPrinters()
        {
            List<Printer_info> list = new List<Printer_info>();
            using (smallerpDataContext db = new smallerpDataContext())
            {
                List<printer> printerList = db.printer.ToList();
                //Printer_info info;
                foreach (printer printer in printerList)
                {
                    list.Add(new Printer_info()
                    {
                        PrinterID = printer.PrinterID,
                        PName = printer.PName,
                        HotDirPath = printer.hotDirPath,
                        IsTransverse = printer.IsTransverse,
                        MonitorDirPath = printer.MonitorDirPath,
                        PBstatus = printer.PBstatus,
                        PDes = printer.PDes,
                        PDPI = printer.PDPI,
                        PLength = printer.PLength,
                        PrintStatus = printer.PrintStatus,
                        PWidth = printer.PWidth
                    });

                }

            }
            return list;
        }
    }
}
